package com.framework.core.api.feign.factory;

import com.framework.common.Enums.FrameworkErrorCodeEnum;
import com.framework.common.domain.R;
import com.framework.common.response.BaseQueryResponse;
import com.framework.core.api.feign.RemoteApiService;
import com.framework.core.api.request.LunimgQueryReq;
import com.framework.core.api.request.ThirdUserInfoReq;
import com.framework.core.api.response.LunimgQueryRes;
import com.framework.core.api.response.ThirdUserInfoQueryRes;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

/**
 * @author zhoubb
 * @version V1.0
 * @Date 2020/4/12 13:59
 * @since JDK 1.8
 */
@Slf4j
@Component
public class RemoteApiFallbackFactory implements FallbackFactory<RemoteApiService> {

    @Override
    public RemoteApiService create(Throwable throwable) {
        log.error(throwable.getMessage());
        return new RemoteApiService() {

            @Override
            public BaseQueryResponse<LunimgQueryRes> getLunimgList(LunimgQueryReq lunimgQueryReq) {
                return null;
            }

            @Override
            public String identityCard(String cardNo) {
                return null;
            }

            @Override
            public String sendSms(String phone, String code, String params, String skin, String name) {
                return null;
            }
        };
    }
}
